//
//  PeopleTwoCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/4/24.
//  Copyright © 2017年 金橙云. All rights reserved.
//
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#import "PeopleTwoCell.h"

@implementation PeopleTwoCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _tuImg = [[UIImageView alloc] init];
        _tuImg.layer.cornerRadius = 15;
       // _tuImg.backgroundColor = [UIColor redColor];
        [self addSubview:_tuImg];
        [_tuImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(30);
            make.top.equalTo(self.mas_top).offset(10);
            make.left.equalTo(self.mas_left).offset(20);
        }];
        
        _titleLab = [[UILabel alloc] init];
        _titleLab.text = @"我的站内信";
        _titleLab.font = [UIFont systemFontOfSize:14];
        [self addSubview:_titleLab];
        [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(200, 30));
            make.left.equalTo(_tuImg.mas_right).offset(30);
            make.centerY.equalTo(self.mas_centerY);
        }];
        
        _hongdainImg = [[UIImageView alloc] init];
        _hongdainImg.layer.cornerRadius = 5;
        _hongdainImg.backgroundColor = [UIColor whiteColor];
        [self addSubview:_hongdainImg];
        [_hongdainImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(10);
            make.top.equalTo(self.mas_top).offset(20);
            make.right.equalTo(self.mas_right).offset(-10);
        }];
        
        
        
        
        
        [self createUI];
    }
    return self;
}


- (void)createUI{
    //创建一个UIView比self.contentView小一圈
    self.bgView  = [[UIView alloc] initWithFrame:CGRectMake(0,4,SCREEN_WIDTH, 46)];
    self.bgView.backgroundColor = [UIColor whiteColor];
    //给bgView边框设置阴影
    self.bgView.layer.shadowOffset = CGSizeMake(2,2);
    self.bgView.layer.shadowOpacity = 0.3;
    self.bgView.layer.shadowColor = [UIColor blackColor].CGColor;
    [self.contentView addSubview:self.bgView];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
